<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>删除留言</title>
</head>

<body>
	<?php
		$theme=$_GET['theme'];
		$conn=mysql_connect("localhost","root","root") or die("连接数据库失败！");
		mysql_select_db("guestbook") or die("选择数据库失败！");
		mysql_query("set names 'utf-8'");
	  	mysql_query("set character set 'utf8'");
		$sql=mysql_query("delete from stateinfo where theme='$theme'");
		if($sql){
			echo "<script>alert('删除成功！');
			window.location.href='../view/allComments.php';</script>";
		}else{
			echo "<script>alert('删除失败！');
			window.location.href='../view/allComments.php';</script>";
		}
		mysql_close($conn);
	?>
</body>
</html>